<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
	language="java"%>
<%@ include file="/jsp/platform/include/include.jsp"%>
<html>
<head>
<TITLE><c:out value="${_LOGONUSER_.MANAGETITILE}" /></TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<%@ include file="/jsp/platform/include/header.jsp"%>

	<script type="text/javascript">
	        function resetForm(){
		    		document.agentInfoForm.reset();
		    }
		    function editAgentInfo() {
		        var checkStr ="need|companyName|公司名称|"+$("#companyName").val()+";"
		                     +"need|companyShortName|公司简称|"+$("#companyShortName").val()+";"
		                     +"need|contacts|联系人|"+$("#contacts").val()+";"
		                     +"need|mobilephone|手机|"+$("#mobilephone").val()+";"
		                     +"need|telephone|联系电话|"+$("#telephone").val()+";"
		                     +"need|email|邮箱|"+$("#email").val()+";"
		                     +"need|bussContact|业务负责人|"+$("#bussContact").val()+";"
		                     +"need|bussMobilephone|手机|"+$("#bussMobilephone").val()+";"
		                     +"need|bussTelephone|联系电话|"+$("#bussTelephone").val()+";"
		                     +"need|bussEmail|邮箱|"+$("#bussEmail").val()+";"
		                     +"need|wxRate|微信结算费率|"+$("#wxRate").val()+";"
		                     +"need|alipayRate|支付宝结算费率|"+$("#alipayRate").val()+";"
		                     +"need|sysAccount|系统账号|"+$("#sysAccount").val()+";"
		                     +"need|sysPassword|登陆密码|"+$("#sysPassword").val()+";"
		                     +"need|depositBank|分润结算银行|"+$("#depositBank").val()+";"
		                     +"need|depositBankbranch|结算支行|"+$("#depositBankbranch").val()+";"
		                     +"need|bankUsrname|开户名|"+$("#bankUsrname").val()+";"
		                     +"need|bankAccount|账户|"+$("#bankAccount").val()+";"
		                     +"mobile|mobilephone|手机|"+$("#mobilephone").val()+";"
		                     +"phone|telephone|联系电话|"+$("#telephone").val()+";"
		                     +"email|email|邮箱|"+$("#email").val()+";"
		                     +"domain|sysPassword|登录密码|"+$("#sysPassword").val()+"|6,18;"
		                     ;
		        //检验唯一性
		        if(!checkAll(checkStr)){
		          return false;
		        }
			    $.messager.confirm("操作提示", "您确定要执行此操作吗！", function (data) {
			        if(data){
			           var url = '<%=request.getContextPath()%>/manage/agentInfo/editAgentInfo';
									$
											.post(
													url,
													{
														'agentInfoModel.agentId' : $(
																"#agentId")
																.val(),
														'agentInfoModel.companyName' : $(
																"#companyName")
																.val(),
														'agentInfoModel.companyShortName' : $(
																"#companyShortName")
																.val(),
														'agentInfoModel.contacts' : $(
																"#contacts")
																.val(),
														'agentInfoModel.mobilephone' : $(
																"#mobilephone")
																.val(),
														'agentInfoModel.telephone' : $(
																"#telephone")
																.val(),
														'agentInfoModel.email' : $(
																"#email").val(),
														'agentInfoModel.sysAccount' : $(
																"#sysAccount")
																.val(),
														'agentInfoModel.sysPassword' : $(
																"#sysPassword")
																.val(),
														'agentInfoModel.openBusstype' : $(
																"#openBusstype")
																.val(),
														'settleCardInfoModel.depositBank' : $(
																"#depositBank")
																.val(),
														'settleCardInfoModel.depositBankbranch' : $(
																"#depositBankbranch")
																.val(),
														'settleCardInfoModel.bankUsrname' : $(
																"#bankUsrname")
																.val(),
														'settleCardInfoModel.bankAccount' : $(
																"#bankAccount")
																.val(),
														'operatorInfoModel.operatorId' : $(
																"#operatorId")
																.val()
													}, function(data) {
														if (data.success) {
															$.messager.alert(
																	"提示信息",
																	data.msg,
																	"info",
																	function() {
																		//window.location.href = window.location.href;
																	});
														} else {
															$.messager.alert(
																	"提示信息",
																	data.msg);
														}
													});
								}
							});
		}
	</script>
</HEAD>
<BODY>
	<DIV class="all">
		<%@ include file="/jsp/platform/include/head.jsp"%>
		<%@ include file="/jsp/platform/include/menu.jsp"%>
		<DIV class="mains">
			<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
				<TBODY>
					<TR valign="top">
						<%@ include file="/jsp/platform/include/mainLeft.jsp"%>
						<TD>
							<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
								<TBODY>
									<TR>
										<TD>
											<TABLE width="180" border="0" cellspacing="0" cellpadding="0">
												<TBODY>
													<TR>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_l.jpg">
														</TD>
														<TD align="center"
															background="<%=request.getContextPath()%>/images/pages_bg.jpg">
															<SPAN class="f_tit1"><c:out value='${agentTitle}' />
														</SPAN></TD>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_r.jpg">
														</TD>
													</TR>
												</TBODY>
											</TABLE></TD>
									</TR>
								</TBODY>
								<TR>
									<TD>
										<div class="pages_con">
											<FORM name="agentInfoForm" id="agentInfoForm"
												action="/buser/BTRANS/0100/1/doInCash" method="post">
												<DIV class="transaction_external">
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">代理等级：</SPAN> <SPAN
															class="label dl_w"
															style="padding-left: 0px; text-align: center; height: 30px; width: 230px;">
															<select id="agentLevel" name="model.agentLevel"
															value="<c:out value='${model.agentLevel}'/>">
																<option value="">请选择代理等级</option>
																<option value="1">代言人</option>
																<option value="2">高级代言人</option>
																<%--<option value="3">城市运营商</option>--%>
														</select> </SPAN><span class="reds f_l">*</span> <SPAN
															class="label cz_label "
															style="width: 120px; text-align: right;">代理类型：</SPAN> <select
															id="agentType" neame="model.agentType"
															value="<c:out value='${model.agentType}'/>">
															<option value="">请选择代理类型</option>
															<option value="1">个人</option>
															<option value="2">企业</option>
														</select></SPAN><span class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">公司名称：</SPAN> <input
															type="hidden" id="agentId" name="agentId"
															value="<c:out value='${model.agentInfoModel.agentId}'/>">
															<input type="hidden" id="operatorId" name="operatorId"
															value="<c:out value='${model.operatorInfoModel.operatorId}'/>">
																<INPUT name="companyName"
																class="txtbox_cz txtbox_cz_color input_change"
																id="companyName" type="text"
																value="<c:out value='${model.agentInfoModel.companyName}'/>">
																	<span class="reds f_l">*</span> <SPAN
																	class="label cz_label "
																	style="width: 120px; text-align: right;">公司简称：</SPAN> <INPUT
																	name="companyShortName"
																	class="txtbox_cz txtbox_cz_color input_change"
																	id="companyShortName" type="text"
																	value="<c:out value='${model.agentInfoModel.companyShortName}'/>">
																		<span class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">联系人：</SPAN> <INPUT
															name="contacts"
															class="txtbox_cz txtbox_cz_color input_change"
															id="contacts" type="text"
															value="<c:out value='${model.agentInfoModel.contacts}'/>">
															<span class="reds f_l">*</span> <SPAN
															class="label cz_label "
															style="width: 120px; text-align: right;">手机：</SPAN> <INPUT
															name="mobilephone"
															class="txtbox_cz txtbox_cz_color input_change"
															id="mobilephone" type="text"
															value="<c:out value='${model.agentInfoModel.mobilephone}'/>">
																<span class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">联系电话：</SPAN> <INPUT
															name="telephone"
															class="txtbox_cz txtbox_cz_color input_change"
															id="telephone" type="text"
															value="<c:out value='${model.agentInfoModel.telephone}'/>"><span
															class="reds f_l">*</span> <SPAN class="label cz_label "
															style="width: 120px; text-align: right;">邮箱：</SPAN> <INPUT
															name="email"
															class="txtbox_cz txtbox_cz_color input_change" id="email"
															type="text"
															value="<c:out value='${model.agentInfoModel.email}'/>"><span
																class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">系统账号：</SPAN> <INPUT
															name="sysAccount"
															class="txtbox_cz txtbox_cz_color input_change"
															id="sysAccount" type="text"
															value="<c:out value='${model.agentInfoModel.sysAccount}'/>">
															<span class="reds f_l">*</span> <SPAN
															class="label cz_label "
															style="width: 120px; text-align: right;">登陆密码：</SPAN> <INPUT
															name="sysPassword"
															class="txtbox_cz txtbox_cz_color input_change"
															id="sysPassword" type="password"
															value="<c:out value='${model.agentInfoModel.sysPassword}'/>">
																<span class="label">请输入6—18位密码</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">分润结算银行：</SPAN> <INPUT
															name="depositBank"
															class="txtbox_cz txtbox_cz_color input_change"
															id="depositBank" type="text"
															value="<c:out value='${model.settleCardInfoModel.depositBank}'/>">
															<span class="reds f_l">*</span> <SPAN
															class="label cz_label "
															style="width: 120px; text-align: right;">结算支行：</SPAN> <INPUT
															name="depositBankbranch"
															class="txtbox_cz txtbox_cz_color input_change"
															id="depositBankbranch" type="text"
															value="<c:out value='${model.settleCardInfoModel.depositBankbranch}'/>"><span
																class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">开户名：</SPAN> <INPUT
															name="bankUsrname"
															class="txtbox_cz txtbox_cz_color input_change"
															id="bankUsrname" type="text"
															value="<c:out value='${model.settleCardInfoModel.bankUsrname}'/>">
															<span class="reds f_l">*</span> <SPAN
															class="label cz_label "
															style="width: 120px; text-align: right;">账户：</SPAN> <INPUT
															name="bankAccount"
															class="txtbox_cz txtbox_cz_color input_change"
															id="bankAccount" type="text"
															value="<c:out value='${model.settleCardInfoModel.bankAccount}'/>"><span
																class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">运营起始时间：</SPAN> <INPUT
															name="bussBegindate" class="easyui-datebox"
															id="bussBegindate" style="border: none" type="text"
															data-options="formatter:myformatter,parser:myparser"
															value="${model.agentInfoModel.bussBegindate}"><span
															class="reds f_l">*</span> <SPAN class="label cz_label "
															style="width: 120px; text-align: right;">运营终止时间：</SPAN><INPUT
															name="bussEnddate" class="easyui-datebox"
															id="bussEnddate" style="border: none" type="text"
															data-options="formatter:myformatter,parser:myparser"
															value="${model.agentInfoModel.bussEnddate}"><span
															class="reds f_l">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">开通业务类型：</SPAN> <INPUT
															name="openBusstype" class="checkbox_cz input_change"
															id="openBusstype" type="checkbox"
															value="<c:out value='${model.agentInfoModel.openBusstype}'/>"
															checked> <span class="label">宝数钱包</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix" id="identityFile" name="fileDiv">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">身份证正面：</SPAN> <input
															type="file" name="legalIndentityImg"
															id="legalIndentityImg" class="ehdel_upload_text"
															value="请选择文件"
															style="height: 31px; margin: 1px 0 0 0;; width: 280px;" />
														<span class="reds">*</span>
													</DIV>
													<DIV class="clearfix"></DIV>
													<DIV class="clearfix" id="bussinessFile" name="fileDiv">
														<SPAN class="label cz_label "
															style="width: 120px; text-align: right;">营业执照正面：</SPAN> <input
															type="file" name="bussinessImg" id="bussinessImg"
															class="ehdel_upload_text" value="请选择文件"
															style="height: 31px; margin: 1px 0 0 0;; width: 280px;" />
														<span class="reds">*</span>
													</DIV>
													<DIV class="clearfix" id="settleCardFile" name="fileDiv">
														<DIV class="clearfix">
															<SPAN class="label cz_label "
																style="width: 120px; text-align: right;">结算银行卡正面：</SPAN>
															<input id="settleCardImg" type="file"
																name="settleCardImg" value="请选择文件"
																style="height: 31px; margin: 1px 0 0 0;; width: 280px;" />
															<span class="reds">*</span>
														</DIV>
													</DIV>
													<DIV class="note">
														<SPAN class="label cz_label">&nbsp;</SPAN> <A
															class="btn confirm" href="javascript:void(0);"
															style="margin-left: 114px;"
															onclick="javaScript:editAgentInfo('<c:out value="${model.agentInfoModel.agentId}"/>');">提交</A><A
															class="btn confirm" href="javascript:void(0);"
															onclick="javaScript:resetForm();">重置</A>
													</DIV>
												</DIV>
											</FORM>
											<!--当中内容块结束-->
										</div></TD>
								</TR>
							</TABLE></TD>
					</TR>
				</TBODY>
			</TABLE>
		</DIV>
		<%@ include file="/jsp/platform/include/foot.jsp"%>
</BODY>
</HTML>
